package com.abc.scholarship.domain.entity;

import com.abc.scholarship.domain.dto.StudentImportDto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 学院表
 * </p>
 *
 * @author LiJunXi
 * @since 2024-07-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("tb_college")
public class College implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 学院ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 学院名称
     */
    @TableField("college_name")
    private String collegeName;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;

    /**
     * 状态（1：正常，2：禁用）
     */
    @TableField("status")
    private Integer status;

    public College(String collegeName) {
        this.collegeName = collegeName;
    }

    public static College buildFromExcel(StudentImportDto stuInfo) {
        return new College(stuInfo.getCollege());
    }
}
